CREATE PROCEDURE sp_ThemThamSo
	@TenTS nvarchar(30),
	@GiaTriTS nvarchar(30)
AS
BEGIN TRAN
	declare @Ma int
	set @Ma = 1
	while exists(SELECT * FROM THAMSO WHERE MaTS = @Ma)
		set @Ma = @Ma + 1
	INSERT INTO THAMSO VALUES(@Ma, @TenTS, @GiaTriTS)
	if(@@error <> 0)
		raiserror('Khong the them tham so',16,1)
COMMIT